package com.atguigu.gmall.item.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @author ：MJS
 * @date ：Created in 2021/5/15  9:17
 * @description：TODO
 */
@Configuration
public class ThreadPoolConfig {
//线程池
    @Bean
    public ThreadPoolExecutor threadPoolExecutor(){
        return new ThreadPoolExecutor(10,
                20,
                4,
                TimeUnit.MINUTES,
                new ArrayBlockingQueue<>(10));
    }
}
